﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simple.Entity.Enums
{
    /// <summary>
    /// 按钮类型
    /// </summary>
    public enum ActionTypeEnum
    {
        /// <summary>
        /// 默认值
        /// </summary>
        None,
        /// <summary>
        /// 查看
        /// </summary>
        Search,
        /// <summary>
        ///  添加
        /// </summary>
        Add,
        /// <summary>
        /// 编辑
        /// </summary>
        Edit,
        /// <summary>
        /// 删除
        /// </summary>
        Delete,
        /// <summary>
        /// 导出
        /// </summary>
        Export,
        /// <summary>
        ///  导入
        /// </summary>
        Import,
        /// <summary>
        /// 设置
        /// </summary>
        Set,
        /// <summary>
        /// 审核
        /// </summary>
        Audit
    }

    /// <summary>
    /// 按钮默认图标
    /// </summary>
    public class ActionTypeHelper
    {
        public static string GetDefaultIcon(ActionTypeEnum actionType)
        {
            string ret = string.Empty;
            List<string> iconList = new List<string>() { 
                "fa fa-folder-o","fa fa-search","fa fa-plus","fa fa-edit","fa fa-cut","fa fa-cloud-download","fa fa-cloud-upload","fa fa-wrench","fa fa-check"
            };
            ret = iconList[(int)actionType];
            if (string.IsNullOrEmpty(ret))
            {
                ret = "fa fa-folder-o";
            }
            return ret;
        }

        public static Dictionary<int, string> GetActionTypeList()
        {
            Dictionary<int, string> actionTypeList = new Dictionary<int, string>();
            actionTypeList.Add((int)ActionTypeEnum.None, ActionTypeEnum.None.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Search, ActionTypeEnum.Search.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Add, ActionTypeEnum.Add.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Edit, ActionTypeEnum.Edit.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Delete, ActionTypeEnum.Delete.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Export, ActionTypeEnum.Export.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Import, ActionTypeEnum.Import.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Set, ActionTypeEnum.Set.ToString());
            actionTypeList.Add((int)ActionTypeEnum.Audit, ActionTypeEnum.Audit.ToString());
            return actionTypeList;
        }
    }
}
